/**
 * 
 */
package co.edu.javeriana.ml;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.SuffixFileFilter;


/**
 * @author ATRIANA
 *
 */
public class ConsolidationFile {
	
	public static void main(String[] args) throws FileNotFoundException, IOException {
		
		File dirSecuences = new File("C:\\Users\\ATRIANA\\Documents\\maestria\\sistemas-inteligentes\\proyecto\\ml\\experiment");
		IOFileFilter filter = new SuffixFileFilter(
				"csv");

		Collection<File> filesSequence = FileUtils.listFiles(
				dirSecuences, filter, null);
		List<String> lstTotal = new ArrayList<String>();
		
		for (File file : filesSequence) {
			List<String> lines = IOUtils.readLines(new FileInputStream(file));
			lstTotal.add(lines.get(1));
		}
		
		FileOutputStream out = new FileOutputStream("C:\\Users\\ATRIANA\\Documents\\maestria\\sistemas-inteligentes\\proyecto\\ml\\experiment\\laplace.csv");
		
		for (String str : lstTotal) {
			IOUtils.write(str+"\n", out);
		}
		
		out.close();
		
	}

}
